<template>
  <div class="itemDate" v-if="itemDate">
    <img class="img" :src="itemDate.image.url" alt="">
    <div class="describt">
      <p>{{ itemDate.summaryText }}</p>
      <p class="p2">{{ itemDate.houseName }}</p>
      <p class="p3">
        <van-rate v-model="commentScore" color="#fff" :size="15" readonly allow-half />
        ￥{{ itemDate.finalPrice }}
      </p>
    </div>
  </div>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
  itemDate: {
    type: Object,
    default: () => ({})
  }
})
const commentScore = computed(() => {
  return Number(props.itemDate.commentScore)
})
</script>
<style lang="less" scoped>
.itemDate {
  width: 49%;
  margin: 7px 0;
  position: relative;

  .img {
    width: 100%;
    border-radius: 5px;
  }

  .describt {
    position: absolute;
    bottom: 0;
    padding: 8px 10px;
    color: #fff;
    font-weight: 500;

    .p2 {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      margin: 7px 0;
    }

    .p3 {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  }
}
</style>